home *** CD-ROM | disk | FTP | other *** search
/ Spiceworld The Movie - Interactive CD-ROM / Spiceworld The Movie: Interactive CD-ROM.iso / pc / elements / spicetwo.dir / scripts_21.ls < prev    next >
Encoding:
Text File  |  1997-12-04  |  1.9 KB  |  44 lines

  1. on movePuzzlePiece
  2.   global PUZZLEPIECESDONE, PRINTLIST
  3.   set lastPieceNo to 14
  4.   set firstPieceNo to 3
  5.   set spriteNo to the clickOn
  6.   set grabbedCastNo to the memberNum of sprite spriteNo
  7.   set grabbedCastLocV to the locV of sprite spriteNo
  8.   set grabbedCastLocH to the locH of sprite spriteNo
  9.   if the name of member the memberNum of sprite spriteNo = (grabbedCastLocH && grabbedCastLocV) then
  10.     exit
  11.   end if
  12.   set locHOffset to the mouseH - grabbedCastLocH
  13.   set locVOffset to the mouseV - grabbedCastLocV
  14.   if spriteNo < lastPieceNo then
  15.     repeat with spriteNo = spriteNo to lastPieceNo - 1
  16.       set nextSpriteNo to spriteNo + 1
  17.       set the memberNum of sprite spriteNo to the memberNum of sprite nextSpriteNo
  18.       set the locV of sprite spriteNo to the locV of sprite nextSpriteNo
  19.       set the locH of sprite spriteNo to the locH of sprite nextSpriteNo
  20.     end repeat
  21.     set the memberNum of sprite lastPieceNo to grabbedCastNo
  22.     set the locV of sprite lastPieceNo to grabbedCastLocV
  23.     set the locH of sprite lastPieceNo to grabbedCastLocH
  24.   end if
  25.   repeat while the mouseDown
  26.     set the locV of sprite lastPieceNo to max(120, the mouseV - locVOffset)
  27.     set the locH of sprite lastPieceNo to the mouseH - locHOffset
  28.     updateStage()
  29.   end repeat
  30.   set testLoc to the name of member the memberNum of sprite lastPieceNo
  31.   if (abs(the locH of sprite lastPieceNo - value(word 1 of testLoc)) < 10) and (abs(the locV of sprite lastPieceNo - value(word 2 of testLoc)) < 10) then
  32.     puppetSound("jigsaw Piece")
  33.     set the locH of sprite lastPieceNo to value(word 1 of testLoc)
  34.     set the locV of sprite lastPieceNo to value(word 2 of testLoc)
  35.     set PUZZLEPIECESDONE to 1 + PUZZLEPIECESDONE
  36.     updateStage()
  37.     if PUZZLEPIECESDONE = (lastPieceNo - firstPieceNo + 1) then
  38.       put "baby spice print" & RETURN after PRINTLIST
  39.       congratulations()
  40.       returnToMainGame(the frameLabel)
  41.     end if
  42.   end if
  43. end
  44.